package com.example.fist.entity;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Date;
import java.util.Objects;

@Entity
@Table(name = "father", schema = "competition", catalog = "")
public class FatherEntity {
    private int faId;
    private String faName;
    private int isvisible;
    private String note;
    private Date modifiTime;
    private Date addTime;
    private Date delTime;
    private String modifiName;
    private String subclass;
    private String reserve;

    @Id
    @Column(name = "fa_id", nullable = false)
    public int getFaId() {
        return faId;
    }

    public void setFaId(int faId) {
        this.faId = faId;
    }

    @Basic
    @Column(name = "fa_name", nullable = false, length = 20)
    public String getFaName() {
        return faName;
    }

    public void setFaName(String faName) {
        this.faName = faName;
    }

    @Basic
    @Column(name = "isvisible", nullable = false)
    public int getIsvisible() {
        return isvisible;
    }

    public void setIsvisible(int isvisible) {
        this.isvisible = isvisible;
    }

    @Basic
    @Column(name = "note", nullable = false, length = -1)
    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    @Basic
    @Column(name = "modifi_time", nullable = false)
    public Date getModifiTime() {
        return modifiTime;
    }

    public void setModifiTime(Date modifiTime) {
        this.modifiTime = modifiTime;
    }

    @Basic
    @Column(name = "add_time", nullable = false)
    public Date getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    @Basic
    @Column(name = "del_time", nullable = true)
    public Date getDelTime() {
        return delTime;
    }

    public void setDelTime(Date delTime) {
        this.delTime = delTime;
    }

    @Basic
    @Column(name = "modifi_name", nullable = true, length = 10)
    public String getModifiName() {
        return modifiName;
    }

    public void setModifiName(String modifiName) {
        this.modifiName = modifiName;
    }

    @Basic
    @Column(name = "subclass", nullable = true, length = 10)
    public String getSubclass() {
        return subclass;
    }

    public void setSubclass(String subclass) {
        this.subclass = subclass;
    }

    @Basic
    @Column(name = "reserve", nullable = true, length = 20)
    public String getReserve() {
        return reserve;
    }

    public void setReserve(String reserve) {
        this.reserve = reserve;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        FatherEntity that = (FatherEntity) o;
        return faId == that.faId &&
                isvisible == that.isvisible &&
                Objects.equals(faName, that.faName) &&
                Objects.equals(note, that.note) &&
                Objects.equals(modifiTime, that.modifiTime) &&
                Objects.equals(addTime, that.addTime) &&
                Objects.equals(delTime, that.delTime) &&
                Objects.equals(modifiName, that.modifiName) &&
                Objects.equals(subclass, that.subclass) &&
                Objects.equals(reserve, that.reserve);
    }

    @Override
    public int hashCode() {
        return Objects.hash(faId, faName, isvisible, note, modifiTime, addTime, delTime, modifiName, subclass, reserve);
    }
}
